package com.genexus.search;

import java.util.Vector;

public class IndexRecord
{
	public final static String URIFIELD = "URI";
	public final static String VIEWERFIELD = "VIEWER";
	public final static String TITLEFIELD = "TITLE";
	public final static String CONTENTFIELD = "CONTENT";
	public final static String ENTITYFIELD = "ENTITY";
	public final static String TIMESTAMPFIELD = "TIME";
	public final static String KEYFIELDPREFIX = "KEY";
        public final static String MATCHFIELD = "MATCH";
        public final static String FOUNDFIELD = "FOUND";
        public final static String DONEFIELD = "DONE";
        public final static String QUERYFIELD = "QUERY";

	public String m_uri;
	private String m_entity;
	private String m_content;
	private String m_viewer;
	private String m_title;
	private String[] m_keys = new String[0];
        private String m_match = "";
        private String m_found = "";
        private boolean m_done;
        private String m_query;

	public IndexRecord() { }
	public IndexRecord(String URI)
	{
                new IndexRecord(URI, "", "", "", "", new Vector(),"", "");
		//this(URI, "", "", "", "", new Vector());
	}
        public IndexRecord(String uri, String entity, String content, String title, String viewer, Vector vectorKeys)
        {
            new IndexRecord(uri, entity, content, title, viewer, vectorKeys, "", "");
        }

	public IndexRecord(String uri, String entity, String content, String title, String viewer, Vector vectorKeys, String match, String found)
	{
		this.m_uri = uri;
		this.m_entity = entity;
		this.m_content = content;
                this.m_match = match;
                this.m_found = found;
                this.m_done = false;
                this.m_query = "";

		if (vectorKeys != null)
		{
			this.m_keys = new String[vectorKeys.size()];
			for (int i = 0; i < vectorKeys.size(); i++)
			{
				this.m_keys[i] = (String)vectorKeys.get(i);
			}
		}
		this.m_title = title;
		this.m_viewer = viewer;
	}

	protected String getUri()
	{
		return this.m_uri;
	}

	protected void setUri(String value)
	{
		this.m_uri = value;
	}
	protected String getEntity()
	{
		return this.m_entity;
	}
	protected void setEntity(String value)
	{
		this.m_entity = value;
	}

	protected String getContent()
	{
		return this.m_content;
	}
	protected void setContent(String value)
	{
		this.m_content = value;
	}

	protected String[] getKeys()
	{
		return this.m_keys;
	}
	protected void setKeys(Vector vectorKeys)
	{
		this.m_keys = new String[vectorKeys.size()];
		for (int i = 0; i < vectorKeys.size(); i++)
		{
			this.m_keys[i] = (String)vectorKeys.get(i);
		}
	}

	protected String getViewer()
	{
		return this.m_viewer;
	}
	protected void setViewer(String value)
	{
		this.m_viewer = value;
	}

	protected String getTitle()
	{
		return this.m_title;
	}
	protected void setTitle(String value)
	{
		this.m_title = value;
	}

        protected void setMatch(String value)
        {
                this.m_match = value;
        }

        protected String getMatch()
        {
                return this.m_match;
        }

        protected String getFound()
        {
                return this.m_found;
        }

        protected void setFound(String value)
        {
                this.m_found = value;
        }

        protected boolean getDone() {
            return this.m_done;
        }

        protected void setDone(boolean value) {
            this.m_done = value;
        }

        protected String getQuery()
        {
            return this.m_query;
        }

        protected void setQuery(String value)
        {
            this.m_query = value;
        }
}
